3.44 \(\int \frac{(a+b x^2) \sin (c+d x)}{x} \, dx\)

Optimal. Leaf size=41 \[ a \sin (c) \text{CosIntegral}(d x)+a \cos (c) \text{Si}(d x)+\frac{b \sin (c+d x)}{d^2}-\frac{b x \cos (c+d x)}{d} \]

[Out]

-((b*x*Cos[c + d*x])/d) + a*CosIntegral[d*x]*Sin[c] + (b*Sin[c + d*x])/d^2 + a*Cos[c]*SinIntegral[d*x]

________________________________________________________________________________________

Rubi [A]  time = 0.0908074, antiderivative size = 41, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.353, Rules used = {3339, 3303, 3299, 3302, 3296, 2637} \[ a \sin (c) \text{CosIntegral}(d x)+a \cos (c) \text{Si}(d x)+\frac{b \sin (c+d x)}{d^2}-\frac{b x \cos (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[((a + b*x^2)*Sin[c + d*x])/x,x]

[Out]

-((b*x*Cos[c + d*x])/d) + a*CosIntegral[d*x]*Sin[c] + (b*Sin[c + d*x])/d^2 + a*Cos[c]*SinIntegral[d*x]

Rule 3339

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*Sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Int[ExpandIntegran
d[Sin[c + d*x], (e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n}, x] && IGtQ[p, 0]

Rule 3303

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Dist[Cos[(d*e - c*f)/d], Int[Sin[(c*f)/d + f*x]
/(c + d*x), x], x] + Dist[Sin[(d*e - c*f)/d], Int[Cos[(c*f)/d + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f},
x] && NeQ[d*e - c*f, 0]

Rule 3299

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinIntegral[e + f*x]/d, x] /; FreeQ[{c, d,
 e, f}, x] && EqQ[d*e - c*f, 0]

Rule 3302

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosIntegral[e - Pi/2 + f*x]/d, x] /; FreeQ
[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]

Rule 3296

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> -Simp[((c + d*x)^m*Cos[e + f*x])/f, x] +
Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{\left (a+b x^2\right ) \sin (c+d x)}{x} \, dx &=\int \left (\frac{a \sin (c+d x)}{x}+b x \sin (c+d x)\right ) \, dx\\ &=a \int \frac{\sin (c+d x)}{x} \, dx+b \int x \sin (c+d x) \, dx\\ &=-\frac{b x \cos (c+d x)}{d}+\frac{b \int \cos (c+d x) \, dx}{d}+(a \cos (c)) \int \frac{\sin (d x)}{x} \, dx+(a \sin (c)) \int \frac{\cos (d x)}{x} \, dx\\ &=-\frac{b x \cos (c+d x)}{d}+a \text{Ci}(d x) \sin (c)+\frac{b \sin (c+d x)}{d^2}+a \cos (c) \text{Si}(d x)\\ \end{align*}

Mathematica [A]  time = 0.131413, size = 54, normalized size = 1.32 \[ a \sin (c) \text{CosIntegral}(d x)+a \cos (c) \text{Si}(d x)-\frac{b \cos (d x) (d x \cos (c)-\sin (c))}{d^2}+\frac{b \sin (d x) (d x \sin (c)+\cos (c))}{d^2} \]

Antiderivative was successfully verified.

[In]

Integrate[((a + b*x^2)*Sin[c + d*x])/x,x]

[Out]

-((b*Cos[d*x]*(d*x*Cos[c] - Sin[c]))/d^2) + a*CosIntegral[d*x]*Sin[c] + (b*(Cos[c] + d*x*Sin[c])*Sin[d*x])/d^2
 + a*Cos[c]*SinIntegral[d*x]

________________________________________________________________________________________

Maple [A]  time = 0.009, size = 60, normalized size = 1.5 \begin{align*}{\frac{ \left ( 1+c \right ) b \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) }{{d}^{2}}}+2\,{\frac{cb\cos \left ( dx+c \right ) }{{d}^{2}}}+a \left ({\it Si} \left ( dx \right ) \cos \left ( c \right ) +{\it Ci} \left ( dx \right ) \sin \left ( c \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x^2+a)*sin(d*x+c)/x,x)

[Out]

(1+c)/d^2*b*(sin(d*x+c)-(d*x+c)*cos(d*x+c))+2*c/d^2*b*cos(d*x+c)+a*(Si(d*x)*cos(c)+Ci(d*x)*sin(c))

________________________________________________________________________________________

Maxima [C]  time = 1.92764, size = 89, normalized size = 2.17 \begin{align*} -\frac{2 \, b d x \cos \left (d x + c\right ) -{\left (a{\left (-i \,{\rm Ei}\left (i \, d x\right ) + i \,{\rm Ei}\left (-i \, d x\right )\right )} \cos \left (c\right ) + a{\left ({\rm Ei}\left (i \, d x\right ) +{\rm Ei}\left (-i \, d x\right )\right )} \sin \left (c\right )\right )} d^{2} - 2 \, b \sin \left (d x + c\right )}{2 \, d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)*sin(d*x+c)/x,x, algorithm="maxima")

[Out]

-1/2*(2*b*d*x*cos(d*x + c) - (a*(-I*Ei(I*d*x) + I*Ei(-I*d*x))*cos(c) + a*(Ei(I*d*x) + Ei(-I*d*x))*sin(c))*d^2
- 2*b*sin(d*x + c))/d^2

________________________________________________________________________________________

Fricas [A]  time = 1.69192, size = 200, normalized size = 4.88 \begin{align*} \frac{2 \, a d^{2} \cos \left (c\right ) \operatorname{Si}\left (d x\right ) - 2 \, b d x \cos \left (d x + c\right ) + 2 \, b \sin \left (d x + c\right ) +{\left (a d^{2} \operatorname{Ci}\left (d x\right ) + a d^{2} \operatorname{Ci}\left (-d x\right )\right )} \sin \left (c\right )}{2 \, d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)*sin(d*x+c)/x,x, algorithm="fricas")

[Out]

1/2*(2*a*d^2*cos(c)*sin_integral(d*x) - 2*b*d*x*cos(d*x + c) + 2*b*sin(d*x + c) + (a*d^2*cos_integral(d*x) + a
*d^2*cos_integral(-d*x))*sin(c))/d^2

________________________________________________________________________________________

Sympy [A]  time = 4.40804, size = 63, normalized size = 1.54 \begin{align*} a \sin{\left (c \right )} \operatorname{Ci}{\left (d x \right )} + a \cos{\left (c \right )} \operatorname{Si}{\left (d x \right )} + b x \left (\begin{cases} - \cos{\left (c \right )} & \text{for}\: d = 0 \\- \frac{\cos{\left (c + d x \right )}}{d} & \text{otherwise} \end{cases}\right ) - b \left (\begin{cases} - x \cos{\left (c \right )} & \text{for}\: d = 0 \\- \frac{\begin{cases} \frac{\sin{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \cos{\left (c \right )} & \text{otherwise} \end{cases}}{d} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x**2+a)*sin(d*x+c)/x,x)

[Out]

a*sin(c)*Ci(d*x) + a*cos(c)*Si(d*x) + b*x*Piecewise((-cos(c), Eq(d, 0)), (-cos(c + d*x)/d, True)) - b*Piecewis
e((-x*cos(c), Eq(d, 0)), (-Piecewise((sin(c + d*x)/d, Ne(d, 0)), (x*cos(c), True))/d, True))

________________________________________________________________________________________

Giac [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)*sin(d*x+c)/x,x, algorithm="giac")

[Out]

Exception raised: TypeError